-
Notifications
You must be signed in to change notification settings - Fork 0
Feature implementation from commits 8cc5cca..208b92b #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature-base-branch-2
Are you sure you want to change the base?
Conversation
- Add download size queries through a HEAD request - Use the file size for progress instead of file count when all file size are available - Add download speed meter
Update GPLAY_PRIVACY_POLICY to be more clear, and remove the news entry as the news in Pojav no longer exists.
Turns out if you were perfectly still, it would fail. For a quick tap, it was fairly easy to create.
NOTE: requires a different version of the FFmpeg plugin which I haven't made yet
void (*set_getmainfbsize)(void (*new_getMainFBSize)(int* width, int* height)) = (void*)GETSYM("set_getmainfbsize"); | ||
if(set_getmainfbsize != NULL) { | ||
__android_log_print(ANDROID_LOG_INFO, g_LogTag, "GL4ES internals initialized dimension callback"); | ||
set_getmainfbsize(gl4esi_get_display_dimensions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐛 Correctness Issue
Undefined function reference.
The code calls gl4esi_get_display_dimensions which appears to be undefined or not declared in the visible code, potentially causing compilation errors or runtime crashes.
Current Code (Diff):
- |8 spaces| set_getmainfbsize(gl4esi_get_display_dimensions);
+ |8 spaces| // Ensure gl4esi_get_display_dimensions is properly defined before using it
+ |8 spaces| set_getmainfbsize(gl4esi_get_display_dimensions);
📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
set_getmainfbsize(gl4esi_get_display_dimensions); | |
// Ensure gl4esi_get_display_dimensions is properly defined before using it | |
set_getmainfbsize(gl4esi_get_display_dimensions); |
__android_log_print(ANDROID_LOG_INFO, g_LogTag, "GL4ES internals initializing..."); | ||
jclass funcProviderClass = (*env)->GetObjectClass(env, function_provider); | ||
jmethodID method_getFunctionAddress = (*env)->GetMethodID(env, funcProviderClass, "getFunctionAddress", "(Ljava/lang/CharSequence;)J"); | ||
#define GETSYM(N) ((*env)->CallLongMethod(env, function_provider, method_getFunctionAddress, (*env)->NewStringUTF(env, N))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐛 Correctness Issue
JNI local reference leak.
The NewStringUTF call creates a local reference that's not released, which could lead to local reference table overflow in loops or long-running operations.
Current Code (Diff):
- #define GETSYM(N) ((*env)->CallLongMethod(env, function_provider, method_getFunctionAddress, (*env)->NewStringUTF(env, N)));
+ #define GETSYM(N) ({ jstring str = (*env)->NewStringUTF(env, N); long result = (*env)->CallLongMethod(env, function_provider, method_getFunctionAddress, str); (*env)->DeleteLocalRef(env, str); result; })
📝 Committable suggestion
‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀
#define GETSYM(N) ((*env)->CallLongMethod(env, function_provider, method_getFunctionAddress, (*env)->NewStringUTF(env, N))); | |
#define GETSYM(N) ({ jstring str = (*env)->NewStringUTF(env, N); long result = (*env)->CallLongMethod(env, function_provider, method_getFunctionAddress, str); (*env)->DeleteLocalRef(env, str); result; }) |
PR Summary
Code Refactoring and Bug Fixes Across Multiple Components
Overview
This PR refactors several components to improve code quality and fix various issues. It includes optimization of the download progress reporting system, fixes for UI components, removal of deprecated code, and native JNI modifications.
Change Types
Affected Modules
src/main/java/com/kdt/CustomSeekbar.java
src/main/java/net/kdt/pojavlaunch/Tools.java
src/main/java/net/kdt/pojavlaunch/mirrors/DownloadMirror.java
src/main/java/net/kdt/pojavlaunch/prefs/QuickSettingSideDialog.java
src/main/java/net/kdt/pojavlaunch/tasks/MinecraftDownloader.java
src/main/jni/ctxbridges/gl_bridge.c
src/main/jni/input_bridge_v3.c
Notes for Reviewers
Additional Context